package cn.tedu.spring.scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestDBConnect {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.scope");
        // 第1次获取,确认对象地址
        DBConnect connect1 = context.getBean(DBConnect.class);
        System.out.println("connect1 = " + connect1);
        // 第2次获取,确认对象地址
        DBConnect connect2 = context.getBean(DBConnect.class);
        System.out.println("connect2 = " + connect2);
    }
}








